package com.demomaster.quickcompat.widget.base;

import android.view.Gravity;

public enum QuickGravity {
    LEFT(android.view.Gravity.LEFT),
    RIGHT(android.view.Gravity.RIGHT),
    TOP(android.view.Gravity.TOP),
    BOTTOM(android.view.Gravity.BOTTOM),
    CENTER(android.view.Gravity.CENTER),
    LEFT_TOP(android.view.Gravity.LEFT | android.view.Gravity.TOP),
    LEFT_BOTTOM(android.view.Gravity.LEFT | android.view.Gravity.BOTTOM),
    RIGHT_TOP(android.view.Gravity.RIGHT | android.view.Gravity.TOP),
    RIGHT_BOTTOM(android.view.Gravity.RIGHT | android.view.Gravity.BOTTOM),
    NO_GRAVITY(Gravity.NO_GRAVITY);

    private int value = 0;

    public int value() {
        return this.value;
    }

    QuickGravity(int value) {
        this.value = value;
    }

    public static QuickGravity getEnum(int value) {
        QuickGravity[] enumArray = QuickGravity.values();
        for (QuickGravity quickGravity : enumArray) {
            if (quickGravity.value() == value) {
                return quickGravity;
            }
        }
        return null;
    }

}
